package com.mp.chart.markerview;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;

import com.mp.chart.components.MarkerView;
import com.mp.chart.data.Entry;
import com.mp.chart.utils.Utils;

/**
 * Created by TenFace on 17/10/25.

 */
public class HightCircleMarkerView extends MarkerView {
    private int size;
    private Paint pan;
    private float radius;
    private int color = 0x6E6D73;
    public HightCircleMarkerView(Context context, int color) {
        super(context);
        this.color=color;
        init();
    }

    @Override
    public void refreshContent(Entry e, int dataSetIndex) {

    }

    @Override
    public int getXOffset() {
        return 0;
    }

    @Override
    public int getYOffset() {
        return 0;
    }

    private void init(){
        size = (int) Utils.convertDpToPixel(5);
        radius = size / 2;
        pan = new Paint();
        pan.setAntiAlias(true);
        pan.setColor(color);
        pan.setStyle(Paint.Style.FILL);
    }
    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        setMeasuredDimension(size, size);
    }

    @Override
    protected void onDraw(Canvas canvas) {
//        pan.setAlpha((int) (255 * getAlpha()));
    //    int showapi_res_body = (int) (radius * getAlpha());
        canvas.drawCircle(0, 0,radius, pan);
    }
}
